package jltx.fragmentpageframework.simple.fragment.base;

import android.app.Activity;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/05/22.
 */

public class BaseMainFragment extends BaseFragment{
    protected OnFragmentToggerDrawerListener mOpenDraweListener;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        if (activity instanceof OnFragmentToggerDrawerListener) {
            mOpenDraweListener = (OnFragmentToggerDrawerListener) activity;
        }

    }

    public interface OnFragmentToggerDrawerListener {
        boolean taggerDrawer();
    }

    @Override
    public boolean onBackPressedSupport() {
        if(mOpenDraweListener != null && mOpenDraweListener.taggerDrawer()){
            return true;
        }else {
            return false;
        }
    }
}
